<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <title>场景操作</title>
    <!--引入第三方的jquery脚本库-->
    <script include="jquery" src="./static/libs/include-lib-local.js"></script>
    <script src="./static/libs/include-cesium-local.js"></script>
    <!--当前示例页面样式表引用-->
    <link rel="stylesheet" href="./static/demo/cesium/style.css" />
    <script>
        'use strict';
        //定义三维视图的主要类
        var webGlobe;
        var sceneManager;
        //地图初始化函数
        function init() {
            //构造三维视图类（视图容器div的id，三维视图设置参数）
            webGlobe = new Cesium.WebSceneControl('GlobeView', {
                terrainExaggeration: 1
            });
            //初始化视图功能管理类
            sceneManager = new CesiumZondy.Manager.SceneManager({
                viewer: webGlobe.viewer
            });
        }

        function zoomin() {
            sceneManager.zoomIn(); //放大
        }

        function zoomout() {
            sceneManager.zoomOut(); //缩小
        }

        function gohome() {
            sceneManager.goHome(); //复位
        }

        function start() {
            sceneManager.openRotation(); //开启自转
        }

        function stop() {
            sceneManager.closeRotation(); //关闭自转
        }

        function change(value) {
            switch (value) {
                case 'skybox':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg',
                            negativeX: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg',
                            positiveY: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg',
                            negativeY: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg',
                            positiveZ: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg',
                            negativeZ: './static/libs/cdn/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
            switch (value) {
                case 'skybox2':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/data/skybox/SkyBox2/tycho2t3_80_px.jpg',
                            negativeX: './static/data/skybox/SkyBox2/tycho2t3_80_mx.jpg',
                            positiveY: './static/data/skybox/SkyBox2/tycho2t3_80_py.jpg',
                            negativeY: './static/data/skybox/SkyBox2/tycho2t3_80_my.jpg',
                            positiveZ: './static/data/skybox/SkyBox2/tycho2t3_80_pz.jpg',
                            negativeZ: './static/data/skybox/SkyBox2/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
            switch (value) {
                case 'skybox3':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/data/skybox/SkyBox3/tycho2t3_80_px.jpg',
                            negativeX: './static/data/skybox/SkyBox3/tycho2t3_80_mx.jpg',
                            positiveY: './static/data/skybox/SkyBox3/tycho2t3_80_py.jpg',
                            negativeY: './static/data/skybox/SkyBox3/tycho2t3_80_my.jpg',
                            positiveZ: './static/data/skybox/SkyBox3/tycho2t3_80_pz.jpg',
                            negativeZ: './static/data/skybox/SkyBox3/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
            switch (value) {
                case 'skybox4':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/data/skybox/SkyBox4/tycho2t3_80_px.jpg',
                            negativeX: './static/data/skybox/SkyBox4/tycho2t3_80_mx.jpg',
                            positiveY: './static/data/skybox/SkyBox4/tycho2t3_80_py.jpg',
                            negativeY: './static/data/skybox/SkyBox4/tycho2t3_80_my.jpg',
                            positiveZ: './static/data/skybox/SkyBox4/tycho2t3_80_pz.jpg',
                            negativeZ: './static/data/skybox/SkyBox4/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
            switch (value) {
                case 'skybox5':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/data/skybox/SkyBox5/tycho2t3_80_px.jpg',
                            negativeX: './static/data/skybox/SkyBox5/tycho2t3_80_mx.jpg',
                            positiveY: './static/data/skybox/SkyBox5/tycho2t3_80_py.jpg',
                            negativeY: './static/data/skybox/SkyBox5/tycho2t3_80_my.jpg',
                            positiveZ: './static/data/skybox/SkyBox5/tycho2t3_80_pz.jpg',
                            negativeZ: './static/data/skybox/SkyBox5/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
            switch (value) {
                case 'skybox6':
                    var skybox = new Cesium.SkyBox({
                        sources: {
                            positiveX: './static/data/skybox/SkyBox6/tycho2t3_80_px.jpg',
                            negativeX: './static/data/skybox/SkyBox6/tycho2t3_80_mx.jpg',
                            positiveY: './static/data/skybox/SkyBox6/tycho2t3_80_py.jpg',
                            negativeY: './static/data/skybox/SkyBox6/tycho2t3_80_my.jpg',
                            positiveZ: './static/data/skybox/SkyBox6/tycho2t3_80_pz.jpg',
                            negativeZ: './static/data/skybox/SkyBox6/tycho2t3_80_mz.jpg'
                        }
                    });
                    sceneManager.changeSkyBox(skybox);
            }
        }
    </script>
</head>

<body onload="init()">
    <div id="GlobeView">
        <div class="message">
            <button id="zoomin" onclick="zoomin()">放大</button>
            <button id="zoomout" onclick="zoomout()">缩小</button>
            <button id="goHome" onclick="gohome()">复位</button>
            <button id="openRotation" onclick="start()">开启自转</button>
            <button id="closeRotation" onclick="stop()">关闭自转</button>
            <select onchange="change(this.value)">
                    <option value="skybox">初始天空盒</option>
                    <option value="skybox2">天空盒2</option>
                    <option value="skybox3">天空盒3</option>
                    <option value="skybox4">天空盒4</option>
                    <option value="skybox5">天空盒5</option>
                    <option value="skybox6">天空盒6</option>
                </select>
        </div>
    </div>
</body>

</html>